#pragma once



#include <cv.h>
#include <highgui.h>
#include <string>

using namespace std;


class CameraDriveImagSeq 
{
private:
	char _nameRootText[512];
	int _index;	
	IplImage* _image ;         /* capture buffer  */
	IplImage* _imageRGB ;         /* capture buffer  */
	int _initialFrame;
	int _finalFrame;
	int _numZeros;
	char _extension[10];
	

public:
	CameraDriveImagSeq( char * rootName ,int ini, int final,int zeros, char ext[10]);
	IplImage*  getFrame( bool next );
	IplImage*  getFrameRGB();
	void setPositionIndex( int frame );
	int getPositionIndex( void ){return _index;}
	void setPositionIndexbyPercent( double val );
	double getPositionIndexbyPercent( void );
	void stepF(void);
	void stepR(void);
	
	int getInitialFrame( void ){return _initialFrame;}
	int getFinalFrame( void ){return _finalFrame;}
	int getHeight( void );
	int getWidth( void );
	void buildName(const char* pattern,int indexCurrentImage,int numberZeros,const char* extencao, string& ret  );
	~CameraDriveImagSeq( void );
};